package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.AddressBookMapper;
import com.ruoyi.order.domain.AddressBook;
import com.ruoyi.order.service.IAddressBookService;

/**
 * 地址管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-19
 */
@Service
public class AddressBookServiceImpl implements IAddressBookService 
{
    @Autowired
    private AddressBookMapper addressBookMapper;

    /**
     * 查询地址管理
     * 
     * @param addressBookId 地址管理主键
     * @return 地址管理
     */
    @Override
    public AddressBook selectAddressBookByAddressBookId(Long addressBookId)
    {
        return addressBookMapper.selectAddressBookByAddressBookId(addressBookId);
    }

    /**
     * 查询地址管理列表
     * 
     * @param addressBook 地址管理
     * @return 地址管理
     */
    @Override
    public List<AddressBook> selectAddressBookList(AddressBook addressBook)
    {
        return addressBookMapper.selectAddressBookList(addressBook);
    }

    /**
     * 新增地址管理
     * 
     * @param addressBook 地址管理
     * @return 结果
     */
    @Override
    public int insertAddressBook(AddressBook addressBook)
    {
        addressBook.setCreateTime(DateUtils.getNowDate());
        return addressBookMapper.insertAddressBook(addressBook);
    }

    /**
     * 修改地址管理
     * 
     * @param addressBook 地址管理
     * @return 结果
     */
    @Override
    public int updateAddressBook(AddressBook addressBook)
    {
        addressBook.setUpdateTime(DateUtils.getNowDate());
        return addressBookMapper.updateAddressBook(addressBook);
    }

    /**
     * 批量删除地址管理
     * 
     * @param addressBookIds 需要删除的地址管理主键
     * @return 结果
     */
    @Override
    public int deleteAddressBookByAddressBookIds(Long[] addressBookIds)
    {
        return addressBookMapper.deleteAddressBookByAddressBookIds(addressBookIds);
    }

    /**
     * 删除地址管理信息
     * 
     * @param addressBookId 地址管理主键
     * @return 结果
     */
    @Override
    public int deleteAddressBookByAddressBookId(Long addressBookId)
    {
        return addressBookMapper.deleteAddressBookByAddressBookId(addressBookId);
    }
}
